package po.emp;
/**
 * 员工类
 * @author admin
 *
 */
public class Empoyee {
	private int empId;
	private String empName;
	private char empSex;
	private int empSalary;  // 工资
	private Job job;        // 职位
	private Title title;    //职称
	private Department depart; //员工部门
	public Empoyee() {
		super();
	}
	public Empoyee(int empId, String empName, char empSex, int empSalary, Job job, Title title, Department depart) {
		super();
		this.empId = empId;
		this.empName = empName;
		this.empSex = empSex;
		this.empSalary = empSalary;
		this.job = job;
		this.title = title;
		this.depart = depart;
	}
	public int getEmpId() {
		return empId;
	}
	public void setEmpId(int empId) {
		this.empId = empId;
	}
	public String getEmpName() {
		return empName;
	}
	public void setEmpName(String empName) {
		this.empName = empName;
	}
	public char getEmpSex() {
		return empSex;
	}
	public void setEmpSex(char empSex) {
		this.empSex = empSex;
	}
	public int getEmpSalary() {
		return empSalary;
	}
	public void setEmpSalary(int empSalary) {
		this.empSalary = empSalary;
	}
	public Job getJob() {
		return job;
	}
	public void setJob(Job job) {
		this.job = job;
	}
	public Title getTitle() {
		return title;
	}
	public void setTitle(Title title) {
		this.title = title;
	}
	public Department getDepart() {
		return depart;
	}
	public void setDepart(Department depart) {
		this.depart = depart;
	}
	@Override
	public String toString() {
		return "Empoyee [empId=" + empId + ", empName=" + empName + ", empSex=" + empSex + ", empSalary=" + empSalary
				+ ", job=" + job + ", title=" + title + ", depart=" + depart + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((depart == null) ? 0 : depart.hashCode());
		result = prime * result + empId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Empoyee other = (Empoyee) obj;
		if (depart == null) {
			if (other.depart != null)
				return false;
		} else if (!depart.equals(other.depart))
			return false;
		if (empId != other.empId)
			return false;
		return true;
	}
	
}
